/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.service.impl;

import cc.altius.dao.MessageDao;
import cc.altius.model.Message;
import cc.altius.service.MessageService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author mudassar
 */
@Service("MessageService")
public class MessageServiceImpl implements MessageService {

    @Autowired
    private MessageDao messageDao;

    @Override
    public int addMessage(Message message, String selectedCustomerIds) {
        return this.messageDao.addMessage(message, selectedCustomerIds);
    }

    @Override
    public List<Map<String, Object>> getMessageList(int sentTo, String startDate, String stopDate, int sentBy) {
        return this.messageDao.getMessageList(sentTo, startDate, stopDate, sentBy);
    }

    @Override
    public int getMessageCountByUserId(int userId) {
        return this.messageDao.getMessageCountByUserId(userId);
    }

    @Override
    public int getunReadMessageCountForCurUser(int userId) {
        return this.messageDao.getunReadMessageCountForCurUser(userId);
    }

    @Override
    public void updateStatus(int messageId) {
        this.messageDao.updateStatus(messageId);
    }

    @Override
    public Message getMessageDetails(int messageId) {
        return this.messageDao.getMessageDetails(messageId);
    }
}
